Recent advances in computer performance have enabled graphic systems to provide more realistic graphical images using personal computers and home video game computers. In such graphic systems, some procedure must be implemented to “render” or draw graphic primitives to the screen of the system. A “graphic primitive” is a basic component of a graphic picture, such as a polygon, e.g., a triangle, or a vector. All graphic pictures are formed with combinations of these graphic primitives. Many procedures may be utilized to perform graphic primitive rendering.
Early graphic systems displayed images representing objects having extremely smooth surfaces. That is, textures, bumps, scratches, or other surface features were not modeled. In order to improve the quality of the image, texture mapping was developed to model the complexity of real world surface images. In general, texture mapping is the mapping of an image or a function onto a surface in three dimensions. Texture mapping is a relatively efficient technique for creating the appearance of a complex image without the tedium and the high computational cost of rendering the actual three dimensional detail that might be found on a surface of an object.
Many parameters have been texture mapped in conventional systems. Some of these parameters include surface color, specular reflection, normal vector perturbation, specularity, transparency, diffuse reflections, and shadows. In texture mapping, a source image known as the “texture” is mapped onto a surface in three dimensional space. The three dimensional surface is then mapped to the destination image. The destination image is then displayed on a graphic display screen. Examples of the texture of an object include the gravel on a highway or scuff marks on a wooden surface.
One tool used during texture mapping is an environment map. An environment map is an image or collection of images which characterize the appearance of a scene when viewed from a particular position. Each type of environment map has an associated projection which is used to compute the appearance along a ray traveling in a particular direction towards the camera. Not all types of environment maps capture the scene in every direction.
A variety of different forms of environment maps have been used in the past. An orthographic projection of a reflecting sphere to characterize the illumination of a scene is described by Williams in “Pyramidal Parametrics”, Computer Graphics, Vol. 17, No. 3, pgs. 1–11, July, 1983. The intention was to use the environment map as an aid to the rapid computation of specular reflections. In an article by Greene entitled “Environment Mapping and Order Applications of Worlds Projections”, IEEE Computer Graphics and Applications, Vol. 6, No. 11, pgs. 21–49, November, 1986, six images on the faces of a cube are used for a “cubic environment map”.
Due to some limitations, spherical environment mapping is challenging to do in real time, and produces artifacts. If the reflection vector is used as an index into a cubic environment map, one can avoid these artifacts since sphere map approximations can also be generated from a six-sided (or cube) environment map by using texture mapping to project the six cube faces onto a sphere. The six cube faces capture the environment color for all 3-D reflection directions without singularities.
During use of a cubic environment map, software renderers calculate a reflection vector for each pixel, and use this to index into an axis-aligned cube map, a latitude/longitude map, or a sin(latitude)/longitude map. The cubic environment map is a general table controlling what is reflected by the surface. Because the map is indexed by the reflection vector, specular spread functions can be incorporated into the maps themselves if they are based solely on the relative reflection angle, thus allowing highlighting, i.e. Phong highlighting.
Cubic environment mapping has proved effective because the eye gets a clear impression of surface curvature from the reflection's distortion of the environment image. Cubic environment maps express source illumination by direction alone. It is built upon texture mapping, which is becoming more common and comparable in performance to linear shading. For more information on the basics of environment mapping, reference may be made to Blinn, Jim and Newell, Martin. “Texture and Reflection in Computer Generated Images”. Communications of the ACM, Vol. 19, No. 10 (1976), pp. 542–547.
Occasionally, when rendering an object using a cubic environment map, one texel, or texture element, will correspond directly to a single pixel that is displayed on a monitor. In this situation the level of detail (LOD) is defined to be equal to zero (0) and the texel is neither magnified nor minified. However, the displayed image can be a magnified or minified representation of the object. If the object is magnified, multiple pixels will represent a single texel. A magnified object corresponds to a negative LOD value. If the object is minified, a single pixel represents multiple texels. A minified object corresponds to a positive LOD value. In general, the LOD value roughly corresponds to the amount of the cubic environment map “covered” by a single pixel. The common convention is that each LOD is exactly half the size of the next higher-detail LOD, but LODs do not need to be restricted that way. Given that common convention, we then define the LOD number as the log2 of the texel to pixel scale ratio. Thus, LOD 0 means the pixel to texel scale is 1 to 1.
The amount of detail stored in different LOD representations may be appreciated by drawing an analogy to the detail perceived by an observer while observing an object. For example, very little detail may be perceived by an observer while watching an automobile from a distance. On the other hand, several details such as doors, windows, mirrors will be perceived if the observer is sufficiently close to the automobile. A finer level LOD may include such additional details also. For example, in Prior Art FIG. 1, the top ball 100 is shown with a LOD that is 2 levels coarser than the bottom ball 102.
During texture mapping, conventional texture coordinates, i.e. s, t, r and q, are received and output coordinates, i.e. u, v, and p are outputted. From such outputted values, the LOD is calculated. One prior art method of calculating the LOD is set forth in Equation #1.